package com.haiyou.dc.thread;

public class TestDaemon {

    public static void main(String[] args) {
        God god = new God();
        Thread thread = new Thread(god);
        thread.setDaemon(true);
        thread.start();

        You2 you2 = new You2();
        new Thread(you2).start();
    }

}

class God implements Runnable {

    @Override
    public void run() {
        while (true) {
            System.out.println("god bless ......");
        }
    }
}

class You2 implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("you bless......" + i);
        }
    }
}
